#include <iostream>

using namespace std;

int year(int n);

int main()
{
    int a, b, cnt = 0;
    cin >> a >> b;
    int t[1000];
    for (int i = a; i <= b; i++)
    {
        if (year(i))
        {
            t[cnt] = i;
            cnt++;
            // cout << i << " ";
        }
    }
    cout << cnt << endl;
    for (int i = 0; i < cnt; i++)
    {
        cout << t[i] << " ";
    }

    return 0;
}

int year(int n)
{
    if (n % 100 != 0 && n % 4 == 0)
    {
        return 1;
    }
    else if (n % 400 == 0)
    {
        return 1;
    }
    return 0;
}